var dataid='alipay';
$('.aui-current-item').click(function(e){
    $(this).addClass('this-card').siblings().removeClass('this-card');
    dataid=$(this).attr('data-id');
})
$('.aui-btn').click(function(e){
    if (dataid=="alipay"){
        document.location.href='/malipay?orCode='+$("#orderCode").val()+"&paynum="+$("#payNum").val();
    }
    else if (dataid=="weipay"){
        //微信支付
        var res={orCode:$("#orderCode").val(), paynum:$("#payNum").val()};
        $.ajax({
            type: 'post',
            url: '/api/getopenid',
            data:JSON.stringify(res),
            dataType: "json",
            async: false,
            contentType: "application/json;charset=UTF-8",
            success: function (data) {
                if (data.code=='20000') {
                    document.location.href=data.data;
                    return false;
                }
            }
        })
    }
})